package com.fled.itsmbigscreen.response;


import com.fled.itsmbigscreen.enums.RetCode;

public class RetResponse {
    private final static String SUCCESS = "success";
    private final static boolean STATUS = true;

    public static <T> BaseResult<T> makeOKRsp() {
        return new BaseResult<T>().setCode(RetCode.SUCCESS).setMsg(SUCCESS).setStatus(STATUS);
    }

    public static <T> BaseResult<T> makeOKRsp(T data) {
        return new BaseResult<T>().setCode(RetCode.SUCCESS).setMsg(SUCCESS).setData(data).setStatus(STATUS);
    }

    public static <T> BaseResult<T> makeErrRsp(String message) {
        return new BaseResult<T>().setCode(RetCode.FAIL).setMsg(message).setStatus(false);
    }

    public static <T> BaseResult<T> makeRsp(int code, String msg) {
        return new BaseResult<T>().setCode(code).setMsg(msg);
    }

    public static <T> BaseResult<T> makeRsp(int code, String msg, T data) {
        return new BaseResult<T>().setCode(code).setMsg(msg).setData(data);
    }
}